const { getOrders, updateOrders, updateOrdersId, deleteOrders } = require('../../dao/orderDao.js');
//获取所有订单
module.exports.getOrders = async params => {
    const data = await getOrders(params);
    if (data) {
        return {
            status: 1,
            msg: '获取订单信息成功',
            data
        }
    }
    return {
        status: 0,
        msg: '获取订单信息失败'
    }
}
//获取修改Id
module.exports.updateOrdersId = async function (params) {
    let data = await updateOrdersId(params)
    if (data) {
        return {
            status: 1,
            msg: '获取ID信息成功',
            data
        }
    }
    return {
        status: 0,
        msg: '获取ID信息失败'
    }
}

//修改订单
module.exports.updateOrders = async function (params) {
    let data = await updateOrders(params)
    if (data) {
        return {
            status: 1,
            msg: '修改订单信息成功',
            data
        }
    }
    return {
        status: 0,
        msg: '修改订单信息失败'
    }
}
//删除订单

module.exports.deleteOrders = async function (params) {
    let data = await deleteOrders(params)
    if (data) {
        return {
            status: 1,
            msg: '删除订单信息成功',
            data
        }
    }
    return {
        status: 0,
        msg: '删除订单信息失败'
    }
}